package org.qfbl.demo1;

import org.qfbl.utils.ByteBufferUtil;

import java.nio.ByteBuffer;

public class TestBytefferRead {

    public static void main(String[] args) {
//        ByteBuffer buffer =  ByteBuffer.allocate(10);
//        buffer.put(new byte[]{'a','b','c','d'}) ;
//        buffer.flip();  // 读模式
//        buffer.get(new byte[4]);
//        ByteBufferUtil.debugAll(buffer);
        ByteBuffer buffer =  ByteBuffer.allocate(16);
        byte[] bytes = "hello".getBytes();
        buffer.put(bytes);
        ByteBufferUtil.debugAll(buffer );
    }

}
